package com.huawei.designpattern.openclose;

/**
 * @Desc 开闭原则，测试方法
 * @Author 阿里P10大神退退
 * @date 2020/4/3 23:41
 */
public class SingleResponsibilityTest {

    // 核心原则：对修改关闭，对扩展开放

    public static void main(String[] args) {
        ICourse iCourse = new JavaCourse(1, "JAVA", 10080D);
        System.out.println("编号 --> " + iCourse.getId());
        System.out.println("名称 --> " + iCourse.getName());
        System.out.println("价格 --> " + iCourse.getPrice());

        JavaDiscountCourse javaDiscountCourse = new JavaDiscountCourse(2, "JAVA", 10000D);
        System.out.println("编号 --> " + javaDiscountCourse.getId());
        System.out.println("名称 --> " + javaDiscountCourse.getName());
        System.out.println("价格 --> " + javaDiscountCourse.getPrice());
        System.out.println("折后价 --> " + javaDiscountCourse.getDiscountPrice());
    }
}
